//
//  NBaseTabBarController.m
//  News
//
//  Created by zhangtao on 2018/10/7.
//  Copyright © 2018年 zt.td. All rights reserved.
//

#import "NBaseTabBarController.h"
#import "NFindTableViewController.h"
#import "NThemeTableViewController.h"
#import "NWalletTableViewController.h"
#import "NMeTableViewController.h"
@interface NBaseTabBarController ()

@end

@implementation NBaseTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];

    NFindTableViewController *find = [[NFindTableViewController alloc]init];
    NThemeTableViewController *theme = [[NThemeTableViewController alloc]init];
    NWalletTableViewController *wallet = [[NWalletTableViewController alloc]init];
    NMeTableViewController *me = [[NMeTableViewController alloc]init];
    
    
    UINavigationController *navFind = [[UINavigationController alloc]initWithRootViewController:find];
    navFind.tabBarItem.image = [[UIImage imageNamed:@"78-78fx1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    navFind.tabBarItem.selectedImage = [[UIImage imageNamed:@"78-78fx"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [navFind.tabBarItem setTitle:NSLocalizedString(@"发现", nil)];
//    [navFind.tabBarItem setTitleTextAttributes:titleNormal forState:UIControlStateNormal];
//    [navFind.tabBarItem setTitleTextAttributes:titleSelected forState:UIControlStateSelected];
    [navFind.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:RGB(76, 195, 138, 1)} forState:UIControlStateSelected];
    
    UINavigationController *navTheme = [[UINavigationController alloc]initWithRootViewController:theme];
    navTheme.tabBarItem.image = [[UIImage imageNamed:@"zt"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    navTheme.tabBarItem.selectedImage = [[UIImage imageNamed:@"绿色主题图标"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [navTheme.tabBarItem setTitle:NSLocalizedString(@"主题", nil)];
    [navTheme.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:RGB(76, 195, 138, 1)} forState:UIControlStateSelected];

    
    UINavigationController *navWallet = [[UINavigationController alloc]initWithRootViewController:wallet];
    navWallet.tabBarItem.image = [[UIImage imageNamed:@"78-78qb-1"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    navWallet.tabBarItem.selectedImage = [[UIImage imageNamed:@"78-78qb"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [navWallet.tabBarItem setTitle:NSLocalizedString(@"钱包", nil)];
    [navWallet.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:RGB(76, 195, 138, 1)} forState:UIControlStateSelected];

    
    
    UINavigationController *navMe = [[UINavigationController alloc]initWithRootViewController:me];
    navMe.tabBarItem.image = [[UIImage imageNamed:@"78-78wd"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    navMe.tabBarItem.selectedImage = [[UIImage imageNamed:@"wd"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [navMe.tabBarItem setTitle:NSLocalizedString(@"我的", nil)];
    [navMe.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:RGB(76, 195, 138, 1)} forState:UIControlStateSelected];

    
    [self setViewControllers:@[navFind,navTheme,navWallet,navMe] animated:YES];

}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
